/*************************************************
Author: will
Date: 3/11/2013
Description:
Notes: 
*************************************************/

#ifndef __CCommConfigLoader_h__
#define __CCommConfigLoader_h__

#include "CCoolingConfig.h"
#include "CAcademyConfig.h"
#include "CSysOpenConfig.h"
#include "CModConfig.h"
#include "CGoldPriceConfig.h"
#include "CZoneConfig.h"
#include "CCrossDomainConfig.h"

class CPlayerOnlineData;

class CCommConfigLoader
{
public:
    CCommConfigLoader() 
    {
    }

    virtual ~CCommConfigLoader() 
    {
    }

    static int CountSize()
    {
        return CZoneConfig::CountSize();
    }

    int Init(const char* sBuf)
    {
        return _stZoneConfig.Init(sBuf);
    }

    int LoadCoolingConfig(const char* sConfigFile);
    int GetCoolingPrice(int iID, int iLeftSec, int& iNeedGold);

    int LoadAcademyConfig(const char* sConfigFile);
    int GetAcademyConfig(int iRank, CAcademyConfigData& stConfigData)
    {
        return _stAcademyConfig.GetConfig(iRank, stConfigData);
    }

    int LoadSysOpenConfig(const char* sConfigFile);
    int GetSysOpenConfig(int iSysID, CSysOpenConfigData& stConfigData)
    {
        return _stSysOpenConfig.GetConfig(iSysID, stConfigData);
    }

    bool IsOpen(int iSysID, CPlayerBaseInfo& stPlayerBaseInfo, CPlayerOnlineData& stPlayerOnlineData);

    int LoadModConfig(const char* sConfigFile);
    int GetModConfig(int iMod, CModConfigData& stConfigData)
    {
        return _stModConfig.GetConfig(iMod, stConfigData);
    }

    int LoadGoldPriceConfig(const char* sConfigFile);

    int LoadZoneConfig(const char* sConfigFile);

    int LoadCrossDomainConfig(const char* sConfigFile);

public:
    CCoolingConfig _stCoolingConfig;
    CAcademyConfig _stAcademyConfig;
    CSysOpenConfig _stSysOpenConfig;
    CModConfig     _stModConfig;
    CGoldPriceConfig _stGoldPriceConfig;
    CZoneConfig _stZoneConfig;
    CCrossDomainConfig _stCrossDomainConfig;
};


#endif // __CCommConfigLoader_h__

